i was hire by the homeowner to do painting job
Typically, direct contractors on owner-occupied residential projects will need to send a preliminary notice in order to preserve mechanics lien rights. That notice should typically be given in the contract itself, or within 10 days of commencing work. Further discussion here: Do I Need to Send a Iowa Preliminary Notice?
Note that there are other tools, besides mechanics liens, that can lead to payment, too. Levelset discusses some of those tools here: Can’t File a Lien? Here Are Some Other Options For Recovery.