Romans 10:5

For Moses describeth the righteousness which is of the law, That the man which doeth those things shall live by them.

Righteousness that comes from the law is measured by doing what the law requires, and the one who performs those requirements obtains life through them. The commandments, statutes, and judgments were appointed to give life, so that both the spiritual welfare and the temporal prosperity of Israel in the land rested upon obedience to them. Such obedience consisted in loving God, walking in His ways, and keeping His law. At the same time the law makes sin known, and persistent rebellion, shown especially in defiling the Sabbaths, called down judgment.