It turns out that Black people were not nearly as scary after they were all freed. Besides, they could have easily asked for volunteers to repatriate to Africa. They surely would have had a number of takers, and Liberia was already available,as was Sierra Leone.
Only a tiny fraction of the White population owned plantations, but they were very, very rich and influential.
Somehow rather a huge amount of cash was raised to fight the wars. They could have paid for the slaves with shares of stock in companies to build transcontinental railroads, of course.
The price for slaves would have to have been established before any was sold.
Slavery could have been ended gradually,as they did in Brazil. There were slaves everywhere in Brazil, but more in the tropical north.
In Brazil, they first declared "Freedom of the womb", meaning that no one born after 1871 was born into slavery.In 1885, slaves over 60 were freed,and in 1888, all the rest were freed, at least officially.
In 2008, 4,634 were freed from over 250 locations where they were enslaved illegally and compensated for this.
The Emperor was overthrown in 1888 by some businessmen, who came to regret what they had done.