These things have I written unto you that believe on the name of the Son of God; that ye may know that ye have eternal life, and that ye may believe on the name of the Son of God. (1 John 5:13 KJV)
Here is the whole purpose of 1 John...that we may know that we have eternal life. This whole book is about assurance and the signs of Christian life that lead to assurance of salvation. But remember to not get the cart in front of the horse. Salvation always precedes works. Our works (signs of Christian life) always come as a result of God's saving work in a person's life, never do our works result in God saving us. John has written so that we might look at our lives and see where God is working in us to do good, not so we might make a list of things we need to do to earn salvation.