Before 1867, In Japan it was strictly used a feudal system very similar to the one of Europe in the middle age.
Emperor: Religious leader.
Shogun: A military commander.
Diamyos: Powerful land owners.
Samurai: High skilled warrior.
Peasants: Farmers and fishermen.
Arisants: sword-maker, dressmaker, woodblock print making etc.
Merchants: People that took advantage from the production of other people.
There were several samurai clans:
1600-1867 Tokugawa clan was the last dominant class
The last tokugawa shogunate was: Yoshinobu
United States, one of the main powers of the West began to have great interest in Japan. In 1837 and 1846 the United States made the first strategy to ensure the realization of trade with Japan, but Japan responded to the United States by sending a "gun-boat diplomacy".
Some Japanese leaders and the Emperor's court were favored by the national resistance, the Tokugawa shogunate was annoyed by the humiliation towards China in the Opium war and realizing that great humiliation accepted the Kanagawa Treaty in March 1854, where it accepted the United States and Japan's trade and was a major exporter of the United States.
In 1858, the Japanese government signed a treaty of friendship and trade with the United States, notwithstanding this not the taste for the imperial court that was dominated by the nationalists and advocated "repelling the barbarians."
Due to all the treaties with the countries of the Western powers and all those signed with the consent of the emperor, the pro-imperialists and anti-incidents managed to create anti-government sentiments and movements. The main defenders of the resistance were mainly the fanatics who fought a kill and died for it and these defenders were called "shishi". These advocates were following the thoughts of Aizawa Seishisai and Sakuma Zozan who also fostered Western technologies.